import React, { Component } from 'react'
import { Text, View, StyleSheet, TouchableOpacity } from 'react-native'
import LinearGradient from 'react-native-linear-gradient';
import { pxToDp } from '../../utils/styleKits';
export default class Thbutton extends Component {
    static defaultProps = {
        styles: {},
        textStyle: {}
    }
    render() {
        return (
            <TouchableOpacity onPress={this.props.onPress} style={{ width: '100%', height: '100%', ...this.props.style }}>
                <LinearGradient start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }} colors={['#9b63cd', '#e0708c',]} style={styles.linearGradient}>
                    <Text style={{ ...styles.buttonText, ...this.props.textStyle }}>
                        {this.props.children}
                    </Text>
                </LinearGradient>
            </TouchableOpacity>
        )
    }
}
const styles = StyleSheet.create({
    linearGradient: {
        flex: 1,
        width: '100%',
        height: '100%',
        alignItems: 'center',
        justifyContent: 'center',
    },
    buttonText: {
        fontSize: pxToDp(18),
        fontFamily: 'Gill Sans',
        textAlign: 'center',
        color: '#fff',
        backgroundColor: 'transparent',
    },
});
